<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class City extends Model
{
    public $table = 'sc_sys_city';

    public $incrementing = false;

    protected $guarded = [];

    public function getShortName($id)
    {
        if ($id == -1 || empty($id)) {
            return '未知';
        }
        $f = $this->find($id);
        if ($f) {
            return $f['name'];
        } else {
            return '未知';
        }
    }
}
